package widgets;

import java.awt.*;
import elements.Link;

public class LinkWidget {
	
	// What computable link do I visualize?
	Link link;
	
	public LinkWidget(Link l) {
		associateWithLink(l);
	}
	
	public void associateWithLink (Link l, boolean remoteRequest) {
		link = l;
	}
	
	private void associateWithLink (Link l) {
		link = l;
		l.associateWithWidget(this, true);
	}
	
	public void drawMe(Graphics2D g2d) {
		g2d.drawLine(
				(int)link.getNodes()[0].getWidget().getX(),
				(int)link.getNodes()[0].getWidget().getY(),
				(int)link.getNodes()[1].getWidget().getX(),
				(int)link.getNodes()[1].getWidget().getY());
	}

}
